CSS for scrollable output & Header colors
Turning scientific / Exponential numbers off
options(scipen = 999)library(tidyverse)
library(ggthemes)library(lubridate)
library(covid19.analytics)
library(data.table)
library(plotly)
library(gghighlight)
library(zoo) # this is for moving averages
# library(ggThemeAssist)
library(glue)
library(scales)
library(ggtext)
library(patchwork)
library(ggforce)
theme_viny_bright <- function(){
library(ggthemes)
ggthemes::theme_fivethirtyeight() %+replace%
theme(
axis.title = element_text(),
axis.text = element_text(size = 13),
legend.text = element_text(size = 10),
panel.background = element_rect(fill = "white"),
plot.background = element_rect(fill = "white"),
strip.background = element_blank(),
legend.background = element_rect(fill = NA),
legend.key = element_rect(fill = NA),
plot.title = element_text(hjust = 0.5, size = 14, face = "plain",
family = "serif"),
plot.subtitle = element_text(hjust = 0.5,face = "plain", family = "serif", size = 9),
plot.caption = element_text(hjust = 1, colour = "maroon", size = 8)
)
}
theme_set(theme_viny_bright())grouped_cases_df %>% head()scaleFactor = max(grouped_cases_df %>%
filter(Country.Region == "India") %>%
pull(Daily_cases)) /
max(grouped_cases_df %>%
filter(Country.Region == "India") %>%
pull(Daily_deaths))
scaleFactorggplot(data = (grouped_cases_df %>% filter(Country.Region == "India")),
aes(x = Date)) +
geom_line(aes(y = Daily_cases), col = "blue") +
geom_line(aes(y = Daily_deaths * scaleFactor), col = "red") +
scale_y_continuous(name = "Daily Cases", sec.axis = sec_axis(~./scaleFactor, name = "Daily Deaths")) +
theme(
axis.title.y.left=element_text(color="blue"),
axis.text.y.left=element_text(color="blue"),
axis.title.y.right=element_text(color="red"),
axis.text.y.right=element_text(color="red")
)this function supports passing of Country.Region names without using quotes but it creates problems for countries that have space in name.
fn_Comapare_confrm_to_deaths <- function(Country_selected = India) {
Country_selected_enquo = enquo(Country_selected)
daily_col = "#32a4ba"
death_col = "#f08080"
grouped_cases_df %>%
filter(Country.Region == quo_name(Country_selected_enquo)) %>%
ggplot(aes(x = Date)) +
geom_line(aes(y = Daily_cases), col = daily_col, size = 0.8) +
geom_line(aes(y = Daily_deaths * scaleFactor), col = death_col, size = 0.8,
size = 0.8, alpha = 0.8) +
scale_y_continuous(name = "Daily Cases", sec.axis = sec_axis(~./scaleFactor, name = "Daily Deaths"),
labels = scales::comma_format()) +
scale_x_date(date_breaks = "1 month", date_labels = "%b") +
theme_excel_new() +
theme(
axis.title.y.left=element_text(color=daily_col),
axis.text.y.left=element_text(color=daily_col),
axis.title.y.right=element_text(color=death_col),
axis.text.y.right=element_text(color=death_col),
plot.title = element_text(face = "plain", family = "serif", size = 14)
) +
theme(plot.title = element_markdown() ) +
labs(title = glue("<i>{quo_name(enquo(Country_selected))}</i>: Daily confirmed & death cases"),
caption = "created by ViSa (SciArt!!)") +
coord_fixed(ratio = .0028)
}
fn_Comapare_confrm_to_deaths(Germany)this function requires passing of Country.Region names within quotes only support country names that have space in it.
fn_Comapare_confrm_to_deaths <- function(Country_selected = "India") {
# Country_selected_enquo = enquo(Country_selected)
daily_col = "#32a4ba"
death_col = "#f08080"
grouped_cases_df %>%
filter(Country.Region == Country_selected) %>%
ggplot(aes(x = Date)) +
geom_line(aes(y = Daily_cases), col = daily_col, size = 0.8) +
geom_line(aes(y = Daily_deaths * scaleFactor), col = death_col,
size = 0.8, alpha = 0.8) +
scale_y_continuous(name = "Daily Cases", sec.axis = sec_axis(~./scaleFactor, name = "Daily Deaths"),
labels = scales::comma_format()) +
scale_x_date(date_breaks = "1 month", date_labels = "%b") +
theme_excel_new() +
theme(
axis.title.y.left=element_text(color=daily_col),
axis.text.y.left=element_text(color=daily_col),
axis.title.y.right=element_text(color=death_col),
axis.text.y.right=element_text(color=death_col),
plot.title = element_text(face = "plain", family = "serif", size = 14)
) +
theme(plot.title = element_markdown()) +
labs(title = glue("<i>{Country_selected}</i>: Daily confirmed & death cases"),
caption = "created by ViSa (SciArt!!)") +
coord_fixed(ratio = .0028)
# coord_fixed(ratio = .008)
}
plt1 <- fn_Comapare_confrm_to_deaths("United Kingdom")
plt1ggplotly(fn_Comapare_confrm_to_deaths("United Kingdom"))
fn_CFR <- function(Country_selected = "India") {
grouped_cases_df %>%
filter(Country.Region == Country_selected) %>%
ggplot(aes(x = Date, y = Case_Fatality_Ratio, col = CFR_level, group = 1)) +
geom_line(size = 0.8) +
scale_y_continuous(labels = label_dollar(prefix = "", suffix = "%")) +
scale_x_date(date_breaks = "1 month", date_labels = "%b") +
theme_excel_new() +
theme(legend.position = "bottom",
plot.title = element_text(face = "plain", family = "serif", size = 14)) +
theme(plot.title = element_markdown()) +
labs(title = glue("<i>{Country_selected}</i>: Case Fatality Ratio(%) & level"),
y = "CFR(%)",
caption = "created by ViSa (SciArt!!)") +
# ylab(label = "CFR (%)")
coord_fixed(ratio = 4)
}
plt2 <- fn_CFR("United Kingdom")
plt2
plt1 / plt2ggsave(filename = "UK_Dailycases.png", dpi = 300)ggplot(data = (grouped_cases_df %>% filter(Country.Region == "India")),
aes(x = Date)) +
geom_col(aes(y = Daily_cases), col = "blue") +
geom_line(aes(y = Daily_deaths * scaleFactor), col = "red") +
scale_y_continuous(name = "Daily Cases", sec.axis = sec_axis(~./scaleFactor, name = "Daily Deaths")) +
theme(
axis.title.y.left=element_text(color="blue"),
axis.text.y.left=element_text(color="blue"),
axis.title.y.right=element_text(color="red"),
axis.text.y.right=element_text(color="red")
)this function supports passing of Country.Region names without using quotes but it creates problems for countries that have space in name.
fn_Comapare_confrm_to_deaths <- function(Country_selected = India) {
Country_selected_enquo = enquo(Country_selected)
daily_col = "#32a4ba"
death_col = "#f08080"
grouped_cases_df %>%
filter(Country.Region == quo_name(Country_selected_enquo)) %>%
ggplot(aes(x = Date)) +
geom_col(aes(y = Daily_cases), fill = daily_col, size = 0.8) +
geom_line(aes(y = Daily_deaths * scaleFactor), col = death_col, size = 0.8,
size = 0.8, alpha = 0.8) +
scale_y_continuous(name = "Daily Cases", sec.axis = sec_axis(~./scaleFactor, name = "Daily Deaths"),
labels = scales::comma_format()) +
scale_x_date(date_breaks = "1 month", date_labels = "%b") +
theme_excel_new() +
theme(
axis.title.y.left=element_text(color=daily_col),
axis.text.y.left=element_text(color=daily_col),
axis.title.y.right=element_text(color=death_col),
axis.text.y.right=element_text(color=death_col),
plot.title = element_text(face = "plain", family = "serif", size = 14)
) +
theme(plot.title = element_markdown() ) +
labs(title = glue("<i>{quo_name(enquo(Country_selected))}</i>: Daily confirmed & death cases"),
caption = "created by ViSa (SciArt!!)") +
coord_fixed(ratio = .0028)
}
fn_Comapare_confrm_to_deaths(Germany)this function requires passing of Country.Region names within quotes only support country names that have space in it.
fn_Comapare_confrm_to_deaths <- function(Country_selected = "India") {
# Country_selected_enquo = enquo(Country_selected)
daily_col = "#32a4ba"
death_col = "#f08080"
grouped_cases_df %>%
filter(Country.Region == Country_selected) %>%
ggplot(aes(x = Date)) +
geom_col(aes(y = Daily_cases), fill = daily_col, size = 0.8) +
geom_line(aes(y = Daily_deaths * scaleFactor), col = death_col,
size = 0.8, alpha = 0.8) +
scale_y_continuous(name = "Daily Cases", sec.axis = sec_axis(~./scaleFactor, name = "Daily Deaths"),
labels = scales::comma_format()) +
scale_x_date(date_breaks = "1 month", date_labels = "%b") +
theme_excel_new() +
theme(
axis.title.y.left=element_text(color=daily_col),
axis.text.y.left=element_text(color=daily_col),
axis.title.y.right=element_text(color=death_col),
axis.text.y.right=element_text(color=death_col),
plot.title = element_text(face = "plain", family = "serif", size = 14)
) +
theme(plot.title = element_markdown()) +
labs(title = glue("<i>{Country_selected}</i>: Daily confirmed & death cases"),
caption = "created by ViSa (SciArt!!)") +
coord_fixed(ratio = .0028)
}
plt1 <- fn_Comapare_confrm_to_deaths("United Kingdom")
plt1ggplotly(fn_Comapare_confrm_to_deaths("United Kingdom"))
fn_CFR <- function(Country_selected = "India") {
grouped_cases_df %>%
filter(Country.Region == Country_selected) %>%
ggplot(aes(x = Date, y = Case_Fatality_Ratio, col = CFR_level, group = 1)) +
geom_line(size = 0.8) +
scale_y_continuous(labels = label_dollar(prefix = "", suffix = "%")) +
scale_x_date(date_breaks = "1 month", date_labels = "%b") +
theme_excel_new() +
theme(legend.position = "bottom",
plot.title = element_text(face = "plain", family = "serif", size = 14)) +
theme(plot.title = element_markdown()) +
labs(title = glue("<i>{Country_selected}</i>: Case Fatality Ratio(%) & level"),
y = "CFR(%)",
caption = "created by ViSa (SciArt!!)") +
# ylab(label = "CFR (%)")
coord_fixed(ratio = 4)
}
plt2 <- fn_CFR("United Kingdom")
plt2
plt1 / plt2
df_stack %>%
filter(str_starts(df_stack$Cases_type, pattern = "Daily_"),
Date > (max(Date, na.rm = TRUE) - 8) & Date < max(Date, na.rm = TRUE)) %>%
group_by(Country.Region, Date, Cases_type) %>%
summarise(Cases_count = sum(Cases_count)) %>%
group_by(Date, Cases_type) %>%
slice_max(order_by = Cases_count, n = 5) %>%
mutate(Cases_size = Cases_count / sum(Cases_count)) %>%
ungroup() %>%
ggplot(aes(x = Cases_type, y = Country.Region)) +
geom_point(shape = 21, aes(size = Cases_size, color = Cases_type), fill="#f8f2e4", stroke=3) +
# theme_minimal() +
theme_wsj() +
theme(axis.text.x = element_text(angle = 90),
axis.text = element_text(size = 8),
legend.position = "none",
plot.title = element_text(face = "bold", family = "serif", size = 20),
plot.subtitle = element_text(face = "plain", family = "serif", size = 12),
plot.caption = element_text(face = "plain", family = "serif", size = 9)) +
scale_color_tableau(palette = "Tableau 10") +
# scale_color_wsj(palette = "colors6") +
facet_wrap(~Date) +
labs(title = "Top 5 Countries for all type of Daily cases",
subtitle = "For Latest 7 days (Size based on each category count for same date)",
caption = "created by ViSa (SciArt!!)") +
coord_cartesian(clip = "off")ref: https://wilkelab.org/ggtext/
solution from: https://stackoverflow.com/questions/65652600/how-to-use-ggtext-to-color-axis-data-labels-in-r/65652801#65652801
color = c(Daily_cases = "#2596be", Daily_deaths = "#f28e2b", Daily_recovered = "#e15759")
df_stack %>%
filter(str_starts(df_stack$Cases_type, pattern = "Daily_"),
Date > (max(Date, na.rm = TRUE) - 8) & Date < max(Date, na.rm = TRUE)) %>%
group_by(Country.Region, Date, Cases_type) %>%
summarise(Cases_count = sum(Cases_count)) %>%
group_by(Date, Cases_type) %>%
slice_max(order_by = Cases_count, n = 5) %>%
mutate(Cases_size = Cases_count / sum(Cases_count)) %>%
ungroup() %>%
# mutate(Cases_type = glue("<i style='color:{color}'>{Cases_type}</i>")) %>%
mutate(Cases_type = glue("<i style='color: {color[Cases_type]}'>{Cases_type}</i>")) %>%
ggplot(aes(x = Cases_type, y = Country.Region)) +
geom_point(shape = 21, aes(size = Cases_size, color = Cases_type), fill="#f8f2e4", stroke=3) +
#theme_minimal() +
theme_wsj() +
theme(axis.text.x = element_text(angle = 90),
axis.text = element_text(size = 8),
legend.position = "none",
plot.title = element_text(face = "bold", family = "serif", size = 20),
plot.subtitle = element_text(face = "plain", family = "serif", size = 12),
plot.caption = element_text(face = "plain", family = "serif", size = 9)) +
theme(axis.text.x = element_markdown()) +
scale_color_manual(values = c("#2596be", "#e15759", "#f28e2b")) +
# scale_color_tableau(palette = "Tableau 10") +
# scale_color_wsj(palette = "colors6") +
facet_wrap(~Date) +
labs(title = "Top 5 Countries for all type of Daily cases",
subtitle = "For Latest 7 days separated by each date",
caption = "created by ViSa (SciArt!!)") +
coord_cartesian(clip = "off")
color = c(Daily_cases = "#2596be", Daily_deaths = "#e15759", Daily_recovered = "#f28e2b")
read.csv("https://raw.githubusercontent.com/johnsnow09/covid19-df_stack-code/main/df_stack_limited.csv") %>%
mutate(Cases_type = glue("<i style='color: {color[Cases_type]}'>{Cases_type}</i>")) %>%
ggplot(aes(x = Cases_type, y = Country.Region)) +
geom_point(shape = 21, aes(size = Cases_size, color = Cases_type), fill="#f8f2e4", stroke=3) +
#theme_minimal() +
theme_wsj() +
theme(axis.text.x = element_text(angle = 90),
axis.text = element_text(size = 8),
legend.position = "none",
plot.title = element_text(face = "bold", family = "serif", size = 20),
plot.subtitle = element_text(face = "plain", family = "serif", size = 12),
plot.caption = element_text(face = "plain", family = "serif", size = 9)) +
theme(axis.text.x = element_markdown()) +
scale_color_manual(values = c("#2596be", "#e15759", "#f28e2b")) +
# scale_color_tableau(palette = "Tableau 10") +
# scale_color_wsj(palette = "colors6") +
facet_wrap(~Date) +
labs(title = "Top 5 Countries for all type of Daily cases",
subtitle = "For Latest 7 days (Size based on each category count for same date)",
caption = "created by ViSa (SciArt!!)") +
coord_cartesian(clip = "off")
df_stack %>%
filter(str_starts(df_stack$Cases_type, pattern = "Daily_"),
Date > (max(Date, na.rm = TRUE) - 8) & Date < max(Date, na.rm = TRUE)) %>%
group_by(Country.Region, Date, Cases_type) %>%
summarise(Cases_count = sum(Cases_count)) %>%
group_by(Date, Cases_type) %>%
slice_max(order_by = Cases_count, n = 5) %>%
mutate(Cases_size = Cases_count / sum(Cases_count)) %>%
ungroup() %>%
ggplot(aes(x = Date, y = Country.Region)) +
geom_point(shape = 21, aes(size = Cases_size, color = Date), fill="#f8f2e4", stroke=3) +
# theme_minimal() +
theme_wsj() +
theme(axis.text.x = element_text(angle = 90),
axis.text = element_text(size = 8),
legend.position = "none",
plot.title = element_text(face = "bold", family = "serif", size = 20),
plot.subtitle = element_text(face = "plain", family = "serif", size = 12),
plot.caption = element_text(face = "plain", family = "serif", size = 9)) +
# scale_color_tableau(palette = "Tableau 20") +
facet_wrap(~Cases_type) +
labs(title = "Top 5 Countries for all type of Daily cases",
subtitle = "For Latest 7 days separated by Cases Type",
caption = "created by ViSa (SciArt!!)") +
coord_cartesian(clip = "off")
df_stack %>%
filter(Cases_type == "Daily_cases",
Date > (max(Date, na.rm = TRUE) - 8) & Date < max(Date, na.rm = TRUE)) %>%
group_by(Country.Region, Date, Cases_type) %>%
summarise(Cases_count = sum(Cases_count)) %>%
group_by(Date, Cases_type) %>%
slice_max(order_by = Cases_count, n = 5) %>%
mutate(Cases_size = Cases_count / sum(Cases_count)) %>%
ungroup() %>%
mutate(Country.Region = fct_reorder(Country.Region, Cases_count, max)) %>%
ggplot(aes(x = Cases_count, y = Country.Region)) +
geom_col(aes(fill = Country.Region)) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90),
legend.position = "none",
plot.title = element_text(face = "plain", family = "serif", size = 14),
plot.subtitle = element_text(face = "plain", family = "serif", size = 9)) +
scale_fill_tableau(palette = "Tableau 20") +
scale_x_continuous(labels = scales::unit_format(scale = 1e-3, unit = "k")) +
facet_wrap(~Date) +
labs(title = "Top 5 Countries by Daily cases",
subtitle = "For Latest 7 days separated by Dates",
caption = "created by ViSa (SciArt!!)",
x = "Daily Cases count",
y = "") +
coord_cartesian(clip = "off")
df_stack %>%
filter(Cases_type == "Daily_recovered",
Date > (max(Date, na.rm = TRUE) - 8) & Date < max(Date, na.rm = TRUE)) %>%
group_by(Country.Region, Date, Cases_type) %>%
summarise(Cases_count = sum(Cases_count)) %>%
group_by(Date, Cases_type) %>%
slice_max(order_by = Cases_count, n = 5) %>%
mutate(Cases_size = Cases_count / sum(Cases_count)) %>%
ungroup() %>%
mutate(Country.Region = fct_reorder(Country.Region, Cases_count, max)) %>%
ggplot(aes(x = Cases_count, y = Country.Region)) +
geom_col(aes(fill = Country.Region)) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90),
legend.position = "none",
plot.title = element_text(face = "plain", family = "serif", size = 14),
plot.subtitle = element_text(face = "plain", family = "serif", size = 9),
plot.background = element_rect(colour = "black", size = 1) ) +
scale_fill_tableau(palette = "Tableau 20") +
scale_x_continuous(labels = scales::unit_format(scale = 1e-3, unit = "k")) +
facet_wrap(~Date) +
labs(title = "Top 5 Countries by Daily Recovered cases",
subtitle = "For Latest 7 days separated by Dates",
caption = "created by ViSa (SciArt!!)",
x = "Daily Recovered Cases count",
y = "") +
coord_cartesian(clip = "off")
df_stack %>%
filter(Cases_type == "Daily_deaths",
Date > (max(Date, na.rm = TRUE) - 8) & Date < max(Date, na.rm = TRUE)) %>%
group_by(Country.Region, Date, Cases_type) %>%
summarise(Cases_count = sum(Cases_count)) %>%
group_by(Date, Cases_type) %>%
slice_max(order_by = Cases_count, n = 5) %>%
mutate(Cases_size = Cases_count / sum(Cases_count)) %>%
ungroup() %>%
mutate(Country.Region = fct_reorder(Country.Region, Cases_count, max)) %>%
ggplot(aes(x = Cases_count, y = Country.Region)) +
geom_col(aes(fill = Country.Region)) +
# theme_minimal() +
theme_clean() +
theme(axis.text.x = element_text(angle = 90),
legend.position = "none",
plot.title = element_text(face = "plain", family = "serif", size = 14),
plot.subtitle = element_text(face = "plain", family = "serif", size = 9)) +
scale_fill_tableau(palette = "Tableau 20") +
scale_x_continuous(labels = scales::unit_format(scale = 1e-3, unit = "k")) +
facet_wrap(~Date) +
labs(title = "Top 5 Countries by Daily Deaths",
subtitle = "For Latest 7 days",
caption = "created by ViSa (SciArt!!)",
x = "Daily Death Cases count",
y = "") +
coord_cartesian(clip = "off")
ggplotly(df_stack %>%
filter(Cases_type == "Daily_deaths",
Date > (max(Date, na.rm = TRUE) - 8) & Date < max(Date, na.rm = TRUE)) %>%
group_by(Country.Region, Date, Cases_type) %>%
summarise(Cases_count = sum(Cases_count)) %>%
group_by(Date, Cases_type) %>%
slice_max(order_by = Cases_count, n = 5) %>%
mutate(Cases_size = Cases_count / sum(Cases_count)) %>%
ungroup() %>%
mutate(Country.Region = fct_reorder(Country.Region, Cases_count, max)) %>%
ggplot(aes(x = Cases_count, y = Country.Region)) +
geom_col(aes(fill = Country.Region)) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90),
legend.position = "none",
plot.title = element_text(face = "plain", family = "serif", size = 14),
plot.subtitle = element_text(face = "plain", family = "serif", size = 9)) +
scale_fill_tableau(palette = "Tableau 20") +
scale_x_continuous(labels = scales::unit_format(scale = 1e-3, unit = "k")) +
facet_wrap(~Date) +
labs(title = "Top 5 Countries of Daily Deaths cases",
subtitle = "For Latest 7 days separated by Dates",
caption = "created by ViSa (SciArt!!)",
x = "Daily Death Cases count",
y = "") +
coord_cartesian(clip = "off")
) %>%
layout(title = list(text = paste0('Top 5 Countries of Daily Deaths cases',
'<br>',
'<sup>',
'For Latest 7 days separated by Dates',
'</sup>')))grouped_cases_df %>%
filter(Date == max(Date, na.rm = TRUE)#,
# Confirmed < 5000000
) %>%
ggplot(aes(x = continent, y = log(Confirmed), label = Country.Region)) +
geom_jitter(size = 1.8, width = 0.35, aes(shape = CFR_level, color = CFR_level)) +
geom_violin(alpha = .5, color = 'grey50', draw_quantiles = c(.25, .5, .75)) +
labs(title = "Latest Confirmend cases across continents",
subtitle = "Colored by CFR severity level",
caption = "created by ViSa (SciArt!!)")
ggplotly(grouped_cases_df %>%
filter(Date == max(Date, na.rm = TRUE)#,
# Confirmed < 5000000
) %>%
ggplot(aes(x = continent, y = log(Confirmed), label = Country.Region)) +
geom_jitter(size = 1.8, width = 0.35, aes(shape = CFR_level, color = CFR_level)) +
geom_violin(alpha = .5, color = 'grey50', draw_quantiles = c(.25, .5, .75)) +
labs(title = "Latest Confirmend cases across continents",
subtitle = "Colored by CFR severity level",
caption = "created by ViSa (SciArt!!)")
)grouped_cases_df %>%
filter(Date == max(Date, na.rm = TRUE)#,
# Active < 5000000
) %>%
ggplot(aes(x = continent, y = log(Active), label = Country.Region)) +
geom_jitter(size = 1.8, width = 0.35, aes(shape = CFR_level, color = CFR_level)) +
geom_violin(alpha = .5, color = 'grey50', draw_quantiles = c(.25, .5, .75)) +
labs(title = "Latest Active cases across continents",
subtitle = "Colored by CFR severity level",
caption = "created by ViSa (SciArt!!)")
ggplotly(grouped_cases_df %>%
filter(Date == max(Date, na.rm = TRUE)#,
# Active < 5000000
) %>%
ggplot(aes(x = continent, y = log(Active), label = Country.Region)) +
geom_jitter(size = 1.8, width = 0.35, aes(shape = CFR_level, color = CFR_level)) +
geom_violin(alpha = .5, color = 'grey50', draw_quantiles = c(.25, .5, .75)) +
labs(title = "Latest Active cases across continents",
subtitle = "Colored by CFR severity level",
caption = "created by ViSa (SciArt!!)")
, tooltip = c("log(Active)", "continent", "label"))grouped_cases_df %>%
filter(Date == max(Date, na.rm = TRUE)#,
# Active < 5000000
) %>%
ggplot(aes(x = continent, y = log(Active), label = Country.Region)) +
geom_violin(alpha = .5, color = 'grey50', draw_quantiles = c(.25, .5, .75)) +
ggforce::geom_sina(alpha = .7, size = 1.8, width = 0.35, aes(shape = CFR_level, color = CFR_level)) +
# geom_jitter() +
labs(title = "Latest Active cases across continents",
subtitle = "Colored by CFR severity level",
caption = "created by ViSa (SciArt!!)")ggplotly(grouped_cases_df %>%
filter(Date == max(Date, na.rm = TRUE)#,
# Active < 5000000
) %>%
ggplot(aes(x = continent, y = log(Active), label = Country.Region)) +
geom_violin(alpha = .5, color = 'grey50', draw_quantiles = c(.25, .5, .75)) +
ggforce::geom_sina(size = 1.8, width = 0.35, aes(shape = CFR_level, color = CFR_level)) +
# geom_jitter() +
labs(title = "Latest Active cases across continents",
subtitle = "Colored by CFR severity level",
caption = "created by ViSa (SciArt!!)")
, tooltip = c("log(Active)", "continent", "label"))